/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sourceryobjects;

import java.io.Serializable;
import sourcery.GraphicsContext;

/**
 *
 * @author claire
 */
public class sRelationType implements Serializable {
    private double strengtha;
    private double strengthb;
    private double minLength;

    public double getMaxAngle() {
        return maxAngle;
    }

    public void setMaxAngle(double maxAngle) {
        this.maxAngle = maxAngle;
    }

    public double getMaxLength() {
        return maxLength;
    }

    public void setMaxLength(double maxLength) {
        this.maxLength = maxLength;
    }

    public double getMinAngle() {
        return minAngle;
    }

    public void setMinAngle(double minAngle) {
        this.minAngle = minAngle;
    }

    public double getMinLength() {
        return minLength;
    }

    public void setMinLength(double minLength) {
        this.minLength = minLength;
    }
    private double maxLength;
    private GraphicsContext.LineStyles style;
    private String name;
    private double minAngle;
    private double maxAngle;
    private boolean angleMode;

    public boolean getAngleMode() {
        return angleMode;
    }

    public void setAngleMode(boolean angleMode) {
        this.angleMode = angleMode;
    }

    public void setStrengthA(double strength) { this.strengtha = strength; }
    public double getStrengthA() { return strengtha; }
    public void setStrengthB(double strength) { this.strengthb = strength; }
    public double getStrengthB() { return strengthb; }

    public void setStyle(GraphicsContext.LineStyles style) { this.style = style; }
    public GraphicsContext.LineStyles  getStyle() { return style; }

    public void setName(String name) { this.name = name; }
    public String getName() { return name; }

    public sRelationType(double strength, double length, GraphicsContext.LineStyles style, String name){
        this.strengtha=strength;
        this.minLength=length;
        this.maxLength=length;
        this.style=style;
        this.name=name;
        this.minAngle=360;
        this.maxAngle=0;
        this.angleMode = true;
    }
    public sRelationType(double strength, double length, GraphicsContext.LineStyles style){
        this(strength, length, style, "Default");
    }


    public void draw(GraphicsContext gc, sNode a, sNode b) {
        gc.DrawLine(a.getCoords(), b.getCoords(), style);
    }
    
    @Override
    public String toString(){
        return style + " coloured, length: " + minLength;
    }
}
